<template>
  <div class="wrap">
    <header>
      <span @click="go">&lt;</span>
      <h3>互动消息</h3>
    </header>
    <main>
      <div class="hudong1">
        <div class="hudong11">
          <dl v-for="(item,index) in HuDongList" :key="index">
            <dt>
              <img :src="item.img" alt />
            </dt>
            <dd>
              <div class="dd1">
                <h4>{{item.title}}</h4>
                <p>{{item.introduce}}</p>
              </div>
              <span>上午7:00</span>
            </dd>
          </dl>
        </div>
      </div>
    </main>
  </div>
</template>

<script>
import axios from "axios";
export default {
  data() {
    return {
      HuDongList: []
    };
  },
  created() {
    this.getList();
  },
  methods: {
    go() {
      this.$router.go(-1);
    },
    getList() {
      axios({
        url: "/api/getList",
        method: "post"
      }).then(res => {
        console.log(res);
        this.HuDongList = res.data.data;
      });
    }
  }
};
</script>

<style lang="scss">
.wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
header {
  width: 100%;
  height: 50px;
  background: rgb(72, 72, 225);
  display: flex;
  width: 100%;
  height: 50px;
  align-items: center;
  text-align: center;
  span {
    padding-left: 5%;
  }
  h3 {
    padding-left: 35%;
  }
}
main {
  flex: 1;
  overflow-y: scroll;
  .hudong1 {
    margin: 15px 0;
    width: 100%;
    height: 200px;
    background: #fff;
    border-radius: 10px;
    .hudong11 {
      align-items: center;
      background: #f1f1f1;
      dl {
        display: flex;
        margin-top: 10px;
        background: #fff;
        padding: 5px;
        dt img {
          width: 60px;
          height: 60px;
          border-radius: 50%;
        }
        dd {
          padding: 5px 15px;
          align-items: center;
          display: flex;
          .dd1 {
            h4 {
              font-size: 16px;
            }
            p {
              padding-top: 15px;
              font-size: 14px;
            }
          }
          span {
            font-size: 14px;
            padding-left: 15px;
          }
        }
      }
      img {
        width: 20px;
        height: 20px;
      }
    }
  }
}
</style>